#include "espFFB.h"
#include "stdint.h"
#include "USBdesc.h"
const uint8_t ffb_hid_report_descriptor[] = {
//  0x05,0x01, // Usage Page Generic Desktop
//  0x09,0x04, // Usage Joystick
//  0xA1,0x01, // Collection Application
//    0x85,0x01, // Report ID 1

//    0x05,0x09, // [0x03]USAGE PAGE (BUTTON)

//    0x19,0x01, // [0x04]USAGE_MINIMUM(BUTTON 1)
//    0x29,0x10, // [0x05]USAGE_MAXIMUM(BUTTON 16)
//    0x15,0x00, // [0x06]LOGICAL_MINIMUM
//    0x25,0x01, // [0x07]LOGICAL_MAXIMUM
//    0x35,0x00, // [0x08]PHYSICAL_MINIMUM
//    0x45,0x01, // [0x09]PHYSICAL_MAXIMUM
//    0x75,0x01, // [0x0A]REPORT_SIZE
//    0x95,0x10, // [0x0B]REPORT_COUNT
//    0x81,0x02, // [0x0C]INPUT

//    0x05,0x01, // [0x0D]USAGE PAGE (GENERIC DESKTOP CONTROLS)
//    0x09,0x39, // [0x0E]USAGE(HAT_SWITCH)
//    0x15,0x00, // [0x0F]LOGICAL_MINIMUM
//    0x25,0x07, // [0x10]LOGICAL_MAXIMUM
//    0x35,0x00, // [0x11]PHYSICAL_MINIMUM
//    0x46,0x3B,0x01, // [0x12]PHYSICAL_MAXIMUM
//    0x65,0x14, // [0x13]UNIT
//    0x75,0x04, // [0x14]REPORT_SIZE
//    0x95,0x01, // [0x15]REPORT_COUNT
//    0x81,0x42, // [0x16]INPUT
//    0x65,0x00, // [0x17]UNIT
//    0x95,0x01, // [0x18]REPORT_COUNT
//    0x81,0x01, // [0x19]INPUT
//    0x09,0x30, // [0x1A]USAGE(X)a
//    0x09,0x31, // [0x1B]USAGE(Y)
//    0x09,0x32, // [0x1C]USAGE(Z)
//    0x09,0x33, // [0x1D]USAGE(Rx)
//    0x15,0x00, // [0x1E]LOGICAL_MINIMUM
//    0x26,0x00,0x04, // [0x1F]LOGICAL_MAXIMUM
//    0x35,0x00, // [0x20]PHYSICAL_MINIMUM
//    0x46,0x00,0x04, // [0x21]PHYSICAL_MAXIMUM
//    0x75,0x10, // [0x22]REPORT_SIZE
//    0x95,0x04, // [0x23]REPORT_COUNT
//    0x81,0x02, // [0x24]INPUT
// // 0xC0,  
0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
   0x09, 0x04,                    // USAGE (Joystick)
   0xa1, 0x01,                    // COLLECTION (Application)
      0xa1, 0x00,                    //   COLLECTION (Physical)
         0x85, 0x01,                    //     REPORT_ID (1)
         0x05, 0x09,                    //     USAGE_PAGE (Button)
         0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
         0x29, 0x40,                    //     USAGE_MAXIMUM (Button 64)
         0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
         0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
         0x95, 0x40,                    //     REPORT_COUNT (64)
         0x75, 0x01,                    //     REPORT_SIZE (1)
         0x81, 0x02,                    //     INPUT (Data,Var,Abs)
         0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)
         0x09, 0x30,             //     USAGE (X)
         0x09, 0x31,             //     USAGE (Y)
         0x09, 0x32,             //     USAGE (Z)
         0x09, 0x33,            //     USAGE (Rx)
         0x09, 0x34,            //     USAGE (Ry)
         0x09, 0x35,            //     USAGE (Rz)
         0x09, 0x36,           //     USAGE (Dial)
         0x09, 0x37,           //     USAGE (Slider)
         0x16, 0x01, 0x80,              //     LOGICAL_MINIMUM (-32767)
         0x26, 0xff, 0x7f,              //     LOGICAL_MAXIMUM (32767)
         0x75, 0x10,                    //     REPORT_SIZE (16)
         0x95, 0x08,                    //     REPORT_COUNT (8)
         0x81, 0x02,                    //     INPUT (Data,Var,Abs)
      0xc0,                          //   END_COLLECTION
 /*
  Input
  Collection Datalink (sub-collection)
  Physical Interface (Usage: PID State report)
  ID: 2
  state report: 5X1bit
  Padding: 3bit
  PID Device Control: 1bit
  Effect Block Index: 7bit 
 */
   0x05,0x0F, // Usage Page Physical Interface
   0x09,0x92, // Usage PID State report 
	0xA1,0x02, // Collection Datalink (logical)
	
      0x85,PID_STATE_REPORT, // Report ID 2
      0x09,0x9F, // Usage Device is Pause 
      0x09,0xA0, // Usage Actuators Enabled
      0x09,0xA4, // Usage Safety Switch
      0x09,0xA5, // Usage Actuator Override Switch
      0x09,0xA6, // Usage Actuator Power
      0x15,0x00, // Logical Minimum 0
      0x25,0x01, // Logical Maximum 1
      0x35,0x00, // Physical Minimum 0
      0x45,0x01, // Physical Maximum 1
      0x75,0x01, // Report Size 1
      0x95,0x05, // Report Count 5
      0x81,0x02, // Input (Variable)
      0x95,0x03, // Report Count 3
      0x81,0x03, // Input (Constant, Variable)


      0x09,0x94, // Usage Effect Playing
      0x15,0x00, // Logical Minimum 0
      0x25,0x01, // Logical Maximum 1
      0x35,0x00, // Physical Minimum 0
      0x45,0x01, // Physical Maximum 1
      0x75,0x01, // Report Size 1
      0x95,0x01, // Report Count 1
      0x81,0x02, // Input (Variable)
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x07, // Report Size 7
      0x95,0x01, // Report Count 1
      0x81,0x02, // Input (Variable)
   0xC0, // End Collection
 
 /*
  Output
  Collection Datalink:
  Usage Set Effect Report
  
  ID:1
  Effect Block Index: 8bit
  
  subcollection Effect Type
  12 effect types, 8bit each

 */
   0x09,0x21, // Usage Set Effect Report
   0xA1,0x02, // Collection Datalink (Logical)
		0x85,SET_EFFECT_REPORT, // Report ID 3

      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)

      0x09,0x25, // Usage Effect Type
      0xA1,0x02, // Collection Datalink
         0x09,0x26, // Usage ET Constant Force
         0x09,0x27, // Usage ET Ramp
         0x09,0x30, // Usage ET Square
         0x09,0x31, // Usage ET Sine
         0x09,0x32, // Usage ET Triangle
         0x09,0x33, // Usage ET Sawtooth Up
         0x09,0x34, // Usage ET Sawtooth Down
         0x09,0x40, // Usage ET Spring
         0x09,0x41, // Usage ET Damper
         0x09,0x42, // Usage ET Inertia
         0x09,0x43, // Usage ET Friction
        // 0x09,0x28, // Usage ET Custom Force Data
         //0x25,0x0C, // Logical Maximum Ch (12d)
         0x25,0x0B,
         0x15,0x01, // Logical Minimum 1
         0x35,0x01, // Physical Minimum 1
         0x45,0x0C, // Physical Maximum Ch (12d)
         0x75,0x08, // Report Size 8
         0x95,0x01, // Report Count 1
         0x91,0x00, // Output

      0xC0 , // End Collection

      0x09,0x50, // Usage Duration
      0x09,0x54, // Usage Trigger Repeat Interval
      0x09,0x51, // Usage Sample Period
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
      0x66,0x03,0x10, // Unit 1003h (4099d)
      0x55,0xFD, // Unit Exponent FDh (253d)
      0x75,0x10, // Report Size 10h (16d)
      0x95,0x03, // Report Count 3
      0x91,0x02, // Output (Variable)

      0x55,0x00, // Unit Exponent 0
      0x66,0x00,0x00, // Unit 0
      0x09,0x52, // Usage Gain
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)

      0x09,0x53, // Usage Trigger Button
      0x15,0x01, // Logical Minimum 1
      0x25,0x08, // Logical Maximum 8
      0x35,0x01, // Physical Minimum 1
      0x45,0x08, // Physical Maximum 8
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)

      0x09,0x55, // Usage Axes Enable
      0xA1,0x02, // Collection Datalink
         0x05,0x01, // Usage Page Generic Desktop
         0x09,0x30, // Usage X
         0x09,0x31, // Usage Y
         0x15,0x00, // Logical Minimum 0
         0x25,0x01, // Logical Maximum 1
         0x75,0x01, // Report Size 1
         0x95,0x02, // Report Count 2
         0x91,0x02, // Output (Variable)
      0xC0 , // End Collection

      0x05,0x0F, // Usage Page Physical Interface
      0x09,0x57, // Usage Direction Enable
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)

      0x95,0x05, // Report Count 5
      0x91,0x03, // Output (Constant, Variable)

      0x09,0x57, // Usage Direction
      0xA1,0x02, // Collection Datalink
         0x0B,0x01,0x00,0x0A,0x00, // Usage Ordinals: Instance 1
         0x0B,0x02,0x00,0x0A,0x00, // Usage Ordinals: Instance 2
         0x66,0x14,0x00, // Unit 14h (20d)
         0x55,0xFE, // Unit Exponent FEh (254d)
         0x15,0x00, // Logical Minimum 0
         0x26,0xFF,0x00, // Logical Maximum FFh (255d)
         0x35,0x00, // Physical Minimum 0
         0x47,0xA0,0x8C,0x00,0x00, // Physical Maximum 8CA0h (36000d)
         0x66,0x00,0x00, // Unit 0
         0x75,0x08, // Report Size 8
         0x95,0x02, // Report Count 2
         0x91,0x02, // Output (Variable)
         0x55,0x00, // Unit Exponent 0
         0x66,0x00,0x00, // Unit 0
      0xC0 , // End Collection

      0x05,0x0F, // Usage Page Physical Interface
      0x09,0xA7, // Usage Undefined
      0x66,0x03,0x10, // Unit 1003h (4099d)
      0x55,0xFD, // Unit Exponent FDh (253d)
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
      0x75,0x10, // Report Size 10h (16d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x66,0x00,0x00, // Unit 0
      0x55,0x00, // Unit Exponent 0
   0xC0 , // End Collection/ Usage Set Effect Report

   0x05,0x0F, // Usage Page Physical Interface
   0x09,0x5A, // Usage Set Envelope Report
   0xA1,0x02, // Collection Datalink

      0x85,SET_ENVELOPE_REPORT, // Report ID 0x04 Usage Set Envelope Report

      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x5B, // Usage Attack Level
      0x09,0x5D, // Usage Fade Level
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x95,0x02, // Report Count 2
      0x91,0x02, // Output (Variable)
      0x09,0x5C, // Usage Attack Time
      0x09,0x5E, // Usage Fade Time
      0x66,0x03,0x10, // Unit 1003h (4099d)
      0x55,0xFD, // Unit Exponent FDh (253d)(miliscond)
      0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
      0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
      0x75,0x10, // Report Size 10h (16d)
      0x91,0x02, // Output (Variable)
      0x45,0x00, // Physical Maximum 0
      0x66,0x00,0x00, // Unit 0
      0x55,0x00, // Unit Exponent 0
   0xC0 , // End Collection

   0x09,0x5F, // Usage Set Condition Report
   0xA1,0x02, // Collection Datalink
      0x85,SET_CONDITION_REPORT, // Report ID 5
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x23, // Usage Parameter Block Offset  ---usage table 193---
      0x15,0x00, // Logical Minimum 0
      0x25,0x01, // Logical Maximum 1
      0x35,0x00, // Physical Minimum 0
      0x45,0x01, // Physical Maximum 1
      0x75,0x04, // Report Size 4
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x58, // Usage Type Specific Block Off...
      0xA1,0x02, // Collection Datalink
         0x0B,0x01,0x00,0x0A,0x00, // Usage Ordinals: Instance 1
         0x0B,0x02,0x00,0x0A,0x00, // Usage Ordinals: Instance 2
         0x75,0x02, // Report Size 2
         0x95,0x02, // Report Count 2
         0x91,0x02, // Output (Variable)
      0xC0 , // End Collection
      0x15,0x80, // Logical Minimum 80h (-128d)
      0x25,0x7F, // Logical Maximum 7Fh (127d)
      0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x09,0x60, // Usage CP Offset
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x09,0x61, // Usage Positive Coefficient
      0x09,0x62, // Usage Negative Coefficient
      0x95,0x02, // Report Count 2
      0x91,0x02, // Output (Variable)
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x09,0x63, // Usage Positive Saturation
      0x09,0x64, // Usage Negative Saturation
      0x75,0x08, // Report Size 8
      0x95,0x02, // Report Count 2
      0x91,0x02, // Output (Variable)
      0x09,0x65, // Usage Dead Band
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x09,0x6E, // Usage Set Periodic Report
   0xA1,0x02, // Collection Datalink
      0x85,SET_PERIODIC_REPORT, // Report ID 6
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x70, // Usage Magnitude
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x6F, // Usage Offset
      0x15,0x80, // Logical Minimum 80h (-128d)
      0x25,0x7F, // Logical Maximum 7Fh (127d)
      0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x71, // Usage Phase
      0x66,0x14,0x00, // Unit 14h (20d)
      0x55,0xFE, // Unit Exponent FEh (254d)
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x47,0xA0,0x8C,0x00,0x00, // Physical Maximum 8CA0h (36000d)
      0x91,0x02, // Output (Variable)
      0x09,0x72, // Usage Period
      0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
      0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
      0x66,0x03,0x10, // Unit 1003h (4099d)
      0x55,0xFD, // Unit Exponent FDh (253d)
      0x75,0x10, // Report Size 10h (16d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x66,0x00,0x00, // Unit 0
      0x55,0x00, // Unit Exponent 0
   0xC0 , // End Collection


   0x09,0x73, // Usage Set Constant Force Rep...
   0xA1,0x02, // Collection Datalink
      0x85,SET_CONSTANT_REPORT, // Report ID 7
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x70, // Usage Magnitude
      0x16,0x01,0xFF, // Logical Minimum FF01h (-255d)
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x75,0x10, // Report Size 10h (16d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x09,0x74, // Usage Set Ramp Force Report
   0xA1,0x02, // Collection Datalink
      0x85,SET_RAMP_REPORT, // Report ID 8
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x75, // Usage Ramp Start
      0x09,0x76, // Usage Ramp End
      0x15,0x80, // Logical Minimum 80h (-128d)
      0x25,0x7F, // Logical Maximum 7Fh (127d)
      0x36,0xF0,0xD8, // Physical Minimum D8F0h (-10000d)
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x75,0x08, // Report Size 8
      0x95,0x02, // Report Count 2
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x09,0x68, // Usage Custom Force  Report
   0xA1,0x02, // Collection Datalink
      0x85,SET_CUSTOM_FORCE_REPORT, // Report ID 9
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x6C, // Usage Custom Force Data Offset
      0x15,0x00, // Logical Minimum 0
      0x26,0x10,0x27, // Logical Maximum 2710h (10000d)
      0x35,0x00, // Physical Minimum 0
      0x46,0x10,0x27, // Physical Maximum 2710h (10000d)
      0x75,0x10, // Report Size 10h (16d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x69, // Usage Custom Force Data
      0x15,0x81, // Logical Minimum 81h (-127d)
      0x25,0x7F, // Logical Maximum 7Fh (127d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x00, // Physical Maximum FFh (255d)
      0x75,0x08, // Report Size 8
      0x95,0x0C, // Report Count Ch (12d)
      0x92,0x02,0x01, // Output (Variable, Buffered)
   0xC0 , // End Collection


   0x09,0x66, // Usage Download Force Sample
   0xA1,0x02, // Collection Datalink
      0x85,DOWNLOAD_FORCE_SAMPLE, // Report ID 10
      0x05,0x01, // Usage Page Generic Desktop
      0x09,0x30, // Usage X
      0x09,0x31, // Usage Y
      0x15,0x81, // Logical Minimum 81h (-127d)
      0x25,0x7F, // Logical Maximum 7Fh (127d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x00, // Physical Maximum FFh (255d)
      0x75,0x08, // Report Size 8
      0x95,0x02, // Report Count 2
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x05,0x0F, // Usage Page Physical Interface
   0x09,0x77, // Usage Effect Operation Report
   0xA1,0x02, // Collection Datalink
      0x85,EFFICT_OPERATION_REPORT, // Report ID 11
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x78, // Usage Effect Operation
      0xA1,0x02, // Collection Datalink
         0x09,0x79, // Usage Op Effect Start
         0x09,0x7A, // Usage Op Effect Start Solo
         0x09,0x7B, // Usage Op Effect Stop
         0x15,0x01, // Logical Minimum 1
         0x25,0x03, // Logical Maximum 3
         0x75,0x08, // Report Size 8
         0x95,0x01, // Report Count 1
         0x91,0x00, // Output
      0xC0 , // End Collection


      0x09,0x7C, // Usage Loop Count
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x00, // Physical Maximum FFh (255d)
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x09,0x90, // Usage PID Block Free Report
   0xA1,0x02, // Collection Datalink
      0x85,FREE_EFFECT_BLOCK_REPORT, // Report ID 11
      0x09,0x22, // Usage Effect Block Index
      0x25,0x28, // Logical Maximum 28h (40d)
      0x15,0x01, // Logical Minimum 1
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x09,0x96, // Usage PID Device Control
   0xA1,0x02, // Collection Datalink
      0x85,SET_CONTROL_DEVICE_REPORT, // Report ID 13  // ok, i get this on HID EP 1 after the PID POOL REPORT
      0x09,0x97, // Usage DC Enable Actuators
      0x09,0x98, // Usage DC Disable Actuators
      0x09,0x99, // Usage DC Stop All Effects
      0x09,0x9A, // Usage DC Device Reset
      0x09,0x9B, // Usage DC Device Pause
      0x09,0x9C, // Usage DC Device Continue
      0x15,0x01, // Logical Minimum 1
      0x25,0x06, // Logical Maximum 6
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x00, // Output
   0xC0 , // End Collection

   0x09,0x7D, // Usage Device Gain Report
   0xA1,0x02, // Collection Datalink
      0x85,SET_GAIN_REPORT, // Report ID 14
      0x09,0x7E, // Usage Device Gain
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x00, // Physical Maximum 255 
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
   0xC0 , // End Collection


   0x09,0x6B, // Usage Set Custom Force Report
   0xA1,0x02, // Collection Datalink
      0x85,0x0F, // Report ID 15
      0x09,0x22, // Usage Effect Block Index
      0x15,0x01, // Logical Minimum 1
      0x25,0x28, // Logical Maximum 28h (40d)
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x6D, // Usage Sample Count
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x00, // Physical Maximum FFh (255d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x09,0x51, // Usage Sample Period
      0x66,0x03,0x10, // Unit 1003h (4099d)
      0x55,0xFD, // Unit Exponent FDh (253d)
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x7F, // Logical Maximum 7FFFh (32767d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x7F, // Physical Maximum 7FFFh (32767d)
      0x75,0x10, // Report Size 10h (16d)
      0x95,0x01, // Report Count 1
      0x91,0x02, // Output (Variable)
      0x55,0x00, // Unit Exponent 0
      0x66,0x00,0x00, // Unit 0
   0xC0 , // End Collection


   0x09,0xAB, // Usage Create New Effect Report
   0xA1,0x02, // Collection Datalink
      0x85,CREATE_NEW_EFFECT_REPORT, // Report ID 16
      0x09,0x25, // Usage Effect Type
      0xA1,0x02, // Collection Datalink
         0x09,0x26, // Usage ET Constant Force
         0x09,0x27, // Usage ET Ramp
         0x09,0x30, // Usage ET Square
         0x09,0x31, // Usage ET Sine
         0x09,0x32, // Usage ET Triangle
         0x09,0x33, // Usage ET Sawtooth Up
         0x09,0x34, // Usage ET Sawtooth Down
         0x09,0x40, // Usage ET Spring
         0x09,0x41, // Usage ET Damper
         0x09,0x42, // Usage ET Inertia
         0x09,0x43, // Usage ET Friction
         0x09,0x28, // Usage ET Custom Force Data
         0x25,0x0C, // Logical Maximum Ch (12d)
         0x15,0x01, // Logical Minimum 1
         0x35,0x01, // Physical Minimum 1
         0x45,0x0C, // Physical Maximum Ch (12d)
         0x75,0x08, // Report Size 8
         0x95,0x01, // Report Count 1
         0xB1,0x00, // Feature
      0xC0 , // End Collection


      0x05,0x01, // Usage Page Generic Desktop
      0x09,0x3B, // Usage Reserved
      0x15,0x00, // Logical Minimum 0
      0x26,0xFF,0x01, // Logical Maximum 1FFh (511d)
      0x35,0x00, // Physical Minimum 0
      0x46,0xFF,0x01, // Physical Maximum 1FFh (511d)
      0x75,0x0A, // Report Size Ah (10d)
      0x95,0x01, // Report Count 1
      0xB1,0x02, // Feature (Variable)
      0x75,0x06, // Report Size 6
      0xB1,0x01, // Feature (Constant)
   0xC0 , // End Collection


   0x05,0x0F, // Usage Page Physical Interface
   0x09,0x89, // Usage PID Block Load Status
   0xA1,0x02, // Collection Datalink
      0x85,EFFECT_LOAD_STATE_REPORT, // Report ID 17
      0x09,0x22, // Usage Effect Block Index
      0x25,0x28, // Logical Maximum 28h (40d)
      0x15,0x01, // Logical Minimum 1
      0x35,0x01, // Physical Minimum 1
      0x45,0x28, // Physical Maximum 28h (40d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0xB1,0x02, // Feature (Variable)
      0x09,0x8B, // Usage Block Load Status
      0xA1,0x02, // Collection Datalink
         0x09,0x8C, // Usage Block Load Success
         0x09,0x8D, // Usage Block Load Full
         0x09,0x8E, // Usage Block Load Error
         0x25,0x03, // Logical Maximum 3
         0x15,0x01, // Logical Minimum 1
         0x35,0x01, // Physical Minimum 1
         0x45,0x03, // Physical Maximum 3
         0x75,0x08, // Report Size 8
         0x95,0x01, // Report Count 1
         0xB1,0x00, // Feature
         /*
         FIELD ADDED
         */
         0x09,0xAC,               //   [0x19]USAGE(RAM POOL AVAILABLE)
         0x15,0x00,               //   [0x1A]LOGICAL_MINIMUM
         0x26,0x96,0x00,          //   [0x1B]LOGICAL_MAXIMUM
         0x75,0x08,               //   [0x1C]REPORT_SIZE
         0x95,0x01,               //   [0x1D]REPORT_COUNT
         0xB1,0x02, // Feature (Variable)
      0xC0 , // End Collection


   0xC0 , // End Collection


   0x09,0x7F, // Usage PID Pool Report
   0xA1,0x02, // Collection Datalink
      0x85,PID_POOL_REPORT, // Report ID 17
      0x09,0x80, // Usage RAM Pool size
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0x15,0x00, // Logical Minimum 0
      0x35,0x00, // Physical Minimum 0
   //-4 byte 
      0x26,0x96,0x00, // Logical Maximum FFFFh (65535d)
      0x46,0x96,0x00, // Physical Maximum FFFFh (65535d)
      0xB1,0x02, // Feature (Variable)

   /*
   +13 bytes  
   ADDING ROM SIZE 0
   */
      0x09,0x81,               //   [0x0B]USAGE(ROM POOL SIZE)
      0x75,0x08,               //   [0x0F]REPORT_SIZE
      0x15,0x00,               //   [0x0C]LOGICAL_MINIMUM
      0x26,0x96,0x00,               //   [0x0D]LOGICAL_MAXIMUM 150
      0x95,0x01,               //   [0x0E]REPORT_COUNT
      0xB1,0x02, 				 //   Feature (Variable)
   //+13
   //-------------------------------end adding rom size
      0x09,0x82,               //   [0x13]USAGE(ROM EFFECT BLOCK COUNT)
      0x75,0x08,               //   [0x14]REPORT_SIZE 8
      0x95,0x01,               //   [0x17]REPORT_COUNT 1
      0x15,0x00,               //   [0x15]LOGICAL_MINIMUM 0
      0x26,0x96,0x00,          //   [0x16]LOGICAL_MAXIMUM 150
      0xB1,0x02,               //   [0x18]FEATURE (Variable)

   //13+13-4=+22
   //-------------------------------end adding rom effect block count
      0x09,0x83, // Usage Simultaneous Effects Max
      0x26,0xFF,0x00, // Logical Maximum FFh (255d)
      0x46,0xFF,0x00, // Physical Maximum FFh (255d)
      0x75,0x08, // Report Size 8
      0x95,0x01, // Report Count 1
      0xB1,0x02, // Feature (Variable)

      0x09,0xA9, // Usage Device Managed Pool
      0x09,0xAA, // Usage Shared Parameter Blocks
      0x75,0x01, // Report Size 1
      0x95,0x02, // Report Count 2
      0x15,0x00, // Logical Minimum 0
      0x25,0x01, // Logical Maximum 1
      0x35,0x00, // Physical Minimum 0
      0x45,0x01, // Physical Maximum 1
      0xB1,0x02, // Feature (Variable)
      0x75,0x06, // Report Size 6
      0x95,0x01, // Report Count 1

      0xB1,0x03, // Feature (Constant, Variable)
   0xC0, // End Collection
   // 0x06,0xFF,0x00,     // USAGE_PAGE (Vendor Page: 0xFF00) 表示一个报文标签之类的用途类页
   // 0x09,0x01,          // USAGE (Vendor Usage 1) 表示一个报告ID标志
   // 0xA1,0x01,          // COLLECTION (Application) 表示应用集合，要以下面最后的0xc0结束它
   //       0x09, 0x03,             //   Usage (0x03)
   //       0x85, CONFIG_REPORT_ID,             //   Report ID (2)
   //       0x15, 0x00,             //   Logical Minimum (0)
   //       0x25, 0xFF,             //   Logical Maximum (255)
   //       0x75, 0x08,             //   Report Size (8)
   //       0x95, 0x01,             //   Report Count (1)
   //       0xB1,0x02,             //   Feature
   //       0x09, 0x01,             //   Usage (0x01)
   //       0x16, 0x00, 0x80,       //   Logical Minimum (-32768)
   //       0x26, 0xFF, 0x7F,       //   Logical Maximum (32767)
   //       0x75, 0x10,             //   Report Size (16)
   //       0x95, 0x01,             //   Report Count (1)
   //       0xB1,0x02,             //   Feature
   // 0xC0,                  // END_COLLECTION
0xC0 // End Collection
 
};
const uint32_t ffb_hid_report_descriptor_length = sizeof(ffb_hid_report_descriptor);

// const uint8_t config_hid_report_descriptor[] = {
//    0x06,0xFF,0x00,     // USAGE_PAGE (Vendor Page: 0xFF00) 表示一个报文标签之类的用途类页
//    0x09,0x01,          // USAGE (Vendor Usage 1) 表示一个报告ID标志
//    0xA1,0x01,          // COLLECTION (Application) 表示应用集合，要以下面最后的0xc0结束它
//       // 读取设备参数 (ID = 1)
//       0xA1,0x02, // Collection Datalink
//          0x85, 0x01,             //   Report ID (1)
//          0x09, 0x01,             //   Usage (0x01)
//          0x15, 0x00,             //   Logical Minimum (0)
//          0x25, 0xFF,             //   Logical Maximum (255)
//          0x75, 0x08,             //   Report Size (8)
//          0x95, 0x01,             //   Report Count (1)
//          0xB1,0x02,             //   Feature
//          0x09, 0x01,             //   Usage (0x01)
//          0x16, 0x00, 0x80,       //   Logical Minimum (-32768)
//          0x26, 0xFF, 0x7F,       //   Logical Maximum (32767)
//          0x75, 0x10,             //   Report Size (16)
//          0x95, 0x01,             //   Report Count (1)
//          0xB1,0x02,             //   Feature
//       0xc0,
//       // 输出报告 (ID = 2)
//       0xA1,0x02, // Collection Datalink
//          0x09, 0x03,             //   Usage (0x03)
//          0x85, 0x02,             //   Report ID (2)
//          0x15, 0x00,             //   Logical Minimum (0)
//          0x25, 0xFF,             //   Logical Maximum (255)
//          0x75, 0x08,             //   Report Size (8)
//          0x95, 0x01,             //   Report Count (1)
//          0xB1,0x02,             //   Feature
//          0x09, 0x01,             //   Usage (0x01)
//          0x16, 0x00, 0x80,       //   Logical Minimum (-32768)
//          0x26, 0xFF, 0x7F,       //   Logical Maximum (32767)
//          0x75, 0x10,             //   Report Size (16)
//          0x95, 0x01,             //   Report Count (1)
//          0xB1,0x02,             //   Feature
//       0xc0,
//    0xC0                  // END_COLLECTION 结束标志
// };
// int a = sizeof(ffb_hid_report_descriptor);
// int b = sizeof(config_hid_report_descriptor );